import React, { useEffect } from "react";
import {useSelector} from "react-redux";
import TopicList from '../../components/topiclist/index'

import { useTopicList } from "../../store/action/index"

export default function Index() {

    const {data,loading,error} = useSelector((state) => state.topics);

    let getData = useTopicList(); // 修改数据时要向 store 里的 action 申请

    useEffect(() => {
        // getData('all',1);
    })
    
    return (

        <>
            <TopicList  data={data} loading={loading}/>
            {loading?"++":"----"}

        </>
    )
}